package com.hxzy.action;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts2.ServletActionContext;
import org.springframework.http.HttpRequest;

import com.hxzy.entity.User;
import com.hxzy.service.TeamService;
import com.hxzy.service.TeamUserService;
import com.hxzy.service.TeamUserServiceImpl;
import com.opensymphony.xwork2.ActionSupport;

public class InvateMemberAction extends ActionSupport{

	/**
	 * 
	 */
	private static final long serialVersionUID = -4930422114824771614L;
	private String email;
	private TeamService teamService;
	private TeamUserService teamUserService;
	@Override
	public String execute() throws Exception {
	    int teamId=(Integer) ServletActionContext.getRequest().getAttribute("team_id");
		User user=teamUserService.find(email);
		
		if(user!=null){
			//save
		//	teamUserService.save(user.getId(), user.getNickname(), teamId, status, remark, uidCreate);
			return SUCCESS;
			
		}else{
			addActionError("邮箱不存在");
			return INPUT;
		}
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

    public TeamService getTeamService() {
        return teamService;
    }

    public void setTeamService(TeamService teamService) {
        this.teamService = teamService;
    }
	
	
}
